<div class="doc-item" id="doc-1389"><h2 class="doc-item-name">sync<span class="namespace">(clojure.core)</span></h2><p class="macro">Macro</p><ul class="var-arglists"><li>(<span class="var-name">sync</span> flags-ignored-for-now &amp; body)</li></ul><div class="var-docstring"><p>transaction-flags =&gt; TBD, pass nil for now</p><p>Runs the exprs (in an implicit do) in a transaction that encompasses
  exprs and any nested calls.  Starts a transaction if none is already
  running on this thread. Any uncaught exception will abort the
  transaction and flow out of sync. The exprs may be run more than
  once, but any effects on Refs will be atomic.</p></div><div class="var-source"><pre>; clojure/core.clj:1392
(defmacro sync
  [flags-ignored-for-now &amp; body]
  `(. clojure.lang.LockingTransaction
      (runInTransaction (fn [] ~@body))))</pre></div><div class="license"><p>Copyright (c) Rich Hickey. All rights reserved.</p><p>The use and distribution terms for this software are covered by the <a href="http://opensource.org/licenses/eclipse-1.0.php">Eclipse Public License 1.0</a>, which can be found in the file
          epl-v10.html at the root of this distribution. By using this software
          in any fashion, you are agreeing to be bound by the terms of this
          license. You must not remove this notice, or any other, from this
          software.</p></div></div>